#ifndef STRING_UTILS_H
#define STRING_UTILS_H

#include "list_utils.h"

# ifdef __cplusplus
extern "C" {
# endif

typedef struct StringArrayInfo {
	unsigned int size;
	char* array;
} StringArrayInfo;

int String_getSplitCount(const char* source, const char* delimiter);
void String_split(char** destination, char* source, const char* delimiter);
char** String_splits(char* source, const char* delimiter, int* size);

void String_splitsWithList(char* source, const char* delimiter, List* resultList);

char* String_replace(char* source, const char* find, const char* replace);
// String replace without change source's size
void String_replaceWithoutChangeSize(char* source, const char* find, const char* replace);

char* String_trim(char* str);

int String_isNumeric(const char* source);

int String_isInteger(const char* source);

int String_copyBySize(char* destination, const char* source, int size);

unsigned char String_checksum(unsigned char *packet, int size);

StringArrayInfo* String_newStringArrayInfo(unsigned int n, unsigned int itemSize);

void String_deleteStringArrayInfo(StringArrayInfo* arrayInfo);

unsigned int String_StringArrayLength(StringArrayInfo* arrayInfo);

char* String_StrCaseStr(const char *haystack, const char *needle);

void String_printHex(char* value, int size);

# ifdef __cplusplus
}
# endif

#endif // STRING_UTILS_H
